﻿@page "/authentication/{action}"
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication
@inject MicroFrontendNavigationManager NavigationManager
@namespace Masa.Stack.Components
@inherits MasaComponentBase
@inject AuthenticationStateProvider AuthenticationStateProvider

<RemoteAuthenticatorView Action="@Action" OnLogInSucceeded="HandleLogInSucceeded" OnLogOutSucceeded="HandleLogOutSucceeded"></RemoteAuthenticatorView>

@code {

    [Parameter] public string Action { get; set; }

    private void HandleLogInSucceeded()
    {
        NavigationManager.NavigateTo("/", true);
    }

    private void HandleLogOutSucceeded()
    {
        NavigationManager.NavigateTo("/authentication/login");
    }
}
